Skip to content

Conversation

@jankatins
Copy link
Contributor

Up to now, a comparison of categorical data and a scalar, which
is not in the categories would return False for all elements when
it should raise a TypeError, which it now does.

Also fix that != comparisons would return False for all elements
when the more logical choice would be True.

Fixes the raised issue in #9836 (comment)

Up to now, a comparison of categorical data and a scalar, which
is not in the categories would return `False` for all elements when
it should raise a `TypeError`, which it now does.

Also fix that `!=` comparisons would return `False` for all elements
when the more logical choice would be `True`.
@kay1793
Copy link

kay1793 commented Apr 12, 2015

Still asking why equality doesn't raise when comparing with a non-existing category.

@shoyer
Copy link
Member

shoyer commented Apr 12, 2015

@kay1793 This is consistent with what Python does for non-comparable types:

# python 3
In [1]: 'foo' == 123
Out[1]: False

In [2]: 'foo' > 123
TypeError: unorderable types: str() > int()

@kay1793
Copy link

kay1793 commented Apr 13, 2015

thanks.

@jreback jreback added Bug Categorical Categorical Data Type labels Apr 13, 2015
@jreback jreback added this to the 0.16.1 milestone Apr 13, 2015
@jreback
Copy link
Contributor

jreback commented Apr 13, 2015

merged via 35b20d8

thank you!

@jreback jreback closed this Apr 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Categorical Categorical Data Type

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants